from Core import view, world, AxisAngle, Vec3, View3d, Drawable, Pickable, Color
from OpenGL.GL import *
from time import sleep


class MyPickable(Pickable):
        
    def isSelectable(self):
        return true

    def draw(self, v):
        glPushAttrib(GL_CURRENT_BIT | GL_ENABLE_BIT | GL_LINE_BIT)
        glDisable(GL_LIGHTING)
        glLineWidth(5)
        if self == v.getHoverItem():
            c = Color(1, 1, 0)
        else:
            c = Color(0.5, 0.5, 0)
        self.setColorIfNotPicking(v, c)
        glBegin(GL_LINES);
        glVertex3d(0,0,0);
        glVertex3d(1,1,0);
        glEnd();
        glPopAttrib()


v = view()
v.addPickable(MyPickable())


